package com.heima.admin.controller;

import com.heima.admin.service.AdminService;
import com.heima.model.admin.dtos.AdminDto;
import com.heima.model.common.dtos.ResponseResult;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author xiaquanen
 * @version 1.0
 * @project heima-leadnews
 * @date 2024/7/29 21:49:33
 */
@RestController
@Slf4j
@RequestMapping("login/in")
public class AdminController {
    @Autowired
    private AdminService adminService;

    @PostMapping
    public ResponseResult adminLogin(@RequestBody AdminDto adminDto) {
        log.info("adminDto:{}", adminDto);
        return adminService.login(adminDto);
    }
}
